use Flap qw/-m -s -w/;

sub{
    my $os = shift;
    my $op = defined($_[1]) && $_[1] =~ /^(?:[<>]|>>)\z/ ? splice(@_, 1, 1) : '';
    $op .= $os->ensure_path_or_safecmd(@_[1 .. $#_]);
    local $::ENV{PATH} = $::ENV{PATH} =~ /(.+)/ && $1 if $os->in_taint_mode;
    CORE::open($_[0], $op);
};
